package com.example.hellodemo;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Paint;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import java.security.spec.EllipticCurve;

public class TextViewActivity extends AppCompatActivity {
    private TextView textView;
    private  TextView t5;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_view);
        textView = findViewById(R.id.tv_4);
        textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
//        textView.getPaint().setAntiAlias(true); // 去除锯齿
        textView.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);// 下划线

        // 跑马灯
        t5 = findViewById(R.id.tv_5);
        t5.setSingleLine(true);
        t5.setEllipsize(TextUtils.TruncateAt.MARQUEE);
        t5.setFocusable(true);
        t5.setFocusableInTouchMode(true);
        t5.setSelected(true);
        t5.setMarqueeRepeatLimit(3);
    }
}
